package org.zhxy.common.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.zhxy.core.personnel.service.TeacherService;
import org.zhxy.core.principal.service.*;
import org.zhxy.core.quality.service.ClassesService;
import org.zhxy.core.quality.service.StudentManagerService;
import org.zhxy.core.system.service.PermissionService;
import org.zhxy.core.system.service.RoleService;
import org.zhxy.core.system.service.UserService;

import javax.annotation.PostConstruct;

@Configuration
public class ServiceFactory {

    //系统
    @Autowired
    private RoleService rs;
    public static RoleService roleService;
    @Autowired
    private PermissionService ps;
    public static PermissionService permissionService;
    @Autowired
    private DictionaryService ds;
    public static DictionaryService dictionaryService;
    @Autowired
    private UserService us;
    public static UserService userService;



    //校长办
    @Autowired
    private SchoolService ss;
    public static SchoolService schoolService;
    @Autowired
    private SubSchoolService sss;
    public static SubSchoolService subSchoolService;
    @Autowired
    private SchoolAssetsService sas;
    public static SchoolAssetsService schoolAssetsService;
    @Autowired
    private DepartmentService dep;
    public static DepartmentService departmentService;
    @Autowired
    private VocationalService vs;
    public static VocationalService vocationalService;
    @Autowired
    private StageService stageS;
    public static StageService stageService;

    //教质
    @Autowired
    private ClassesService cs;
    public static ClassesService classesService;
    @Autowired
    private StudentManagerService sms;
    public static StudentManagerService studentManagerService;

    //人事行政
    @Autowired
    private TeacherService ts;
    public static TeacherService teacherService;

    @PostConstruct
    public void initService(){
        roleService = this.rs;
        permissionService = this.ps;
        dictionaryService = this.ds;
        userService = this.us;

        schoolService = this.ss;
        subSchoolService = this.sss;
        schoolAssetsService = this.sas;
        departmentService = this.dep;
        vocationalService = this.vs;
        stageService = this.stageS;



        classesService = this.cs;
        studentManagerService = this.sms;





        teacherService = this.ts;
    }
}
